package com.nguyen.letcook;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class MainTabHost extends TabActivity {

	TabHost tabHost;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       	setContentView(R.layout.loadtabgreen);
          
       	
       	Resources res = getResources(); // Resource object to get Drawables
        tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab
        
        intent = new Intent().setClass(MainTabHost.this, LetCookActivity.class);
        spec = tabHost.newTabSpec("home").setIndicator("Home",
                          res.getDrawable(R.drawable.mall))
                      .setContent(intent);
        tabHost.addTab(spec);

        /**
        intent = new Intent().setClass(MainTabHost.this, DealsActivity.class);
        spec = tabHost.newTabSpec("deals").setIndicator("Promotions",
                          res.getDrawable(R.drawable.ic_tab_store))
                      .setContent(intent);
        tabHost.addTab(spec);
        
        intent = new Intent().setClass(MainTabHost.this, MyBookingActivity.class);    
        spec = tabHost.newTabSpec("mybooking").setIndicator(" My Purchases ",
                          res.getDrawable(R.drawable.ic_tab_mycart))
                      .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(MainTabHost.this, SettingActivity.class);
        spec = tabHost.newTabSpec("setting").setIndicator("Settings",
                          res.getDrawable(R.drawable.ic_tab_setting))
                      .setContent(intent);
        tabHost.addTab(spec);
        tabHost.setCurrentTab(tab);
        */
	}
	
	public void switchTab(int tab)
	{             
		tabHost.setCurrentTab(tab); 
	} 
}